/*
 * @Author: wxinlong 3075748076@qq.com
 * @Date: 2023-06-17 10:27:05
 * @LastEditors: wxinlong 3075748076@qq.com
 * @LastEditTime: 2023-06-17 11:31:36
 * @Description: 文件控制器
 * Copyright (c) 2023 by wxinlong 3075748076@qq.com, All Rights Reserved.
 */
async function uploadFile(req, res) {
  const { file } = req

  if (!file) {
    return res.status(400).json({ message: '未提供文件！' })
  }

  // 返回图片地址
  res.json({ msg: '文件上传成功！', filePath: file.path })
}

module.exports = { uploadFile }
